<?php

class Kd_Html_Form_File extends Kd_Html_Form_Element {
	
	private $_uploadUrl = '';
	private $_fileExtension = '';
	private $_baseUrl = '';
	private $_multiple = FALSE;
	
    public function __construct() {
        parent::__construct();
        $this->templateName = 'form/file';
        $this->addClass('input', 'file');
    }
    
    public function getFileExtension(){
    	return $this->_fileExtension;
    }
    
    public function setFileExtension($value){
    	$this->_fileExtension = $value;
    	return $this;
    }
    
    public function getUploadUrl(){
    	return $this->_uploadUrl;
    }
    
    public function setUploadUrl($value){
    	$this->_uploadUrl;
    	return $this;
    }
    
    public function getBaseUrl(){
    	return $this->_baseUrl;
    }
    
    public function setBaseUrl($value){
    	$this->_baseUrl = $value;
    }
    
    public function getMultiple(){
    	return $this->_multiple;
    }
    
    public function setMultiple($value){
    	$this->_multiple = $value;
    	return $this;
    }

    protected function renderReadonly() {
        return '';
    }

    protected function renderEditable() {
        if (!$this->getEnabled()) {
            $this->addClass('disabled');
        }
        $this->setAttribute('type', 'file')
                ->setAttribute('id', $this->getId())
                ->setAttribute('name', $this->getName());
        if (!$this->getEnabled()) {
            $this->setAttribute('disabled', 'disabled');
        }
        return '<input ' . $this->getAttributeHtml() . '/>';
    }

}